$location, 'menu' => '', 'container' => 'div', 'container_class' => 'menu-{menu slug}-container', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => $before, 'link_after' => '', 'items_wrap' => '', 'depth' => $depth, 'walker' => '' ) ); } // Load HTML5 Blank scripts (header.php) function html5blank_header_scripts() { if (!is_admin()) { wp_deregister_script('jquery'); // Deregister WordPress jQuery wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', array(), '1.10.2', true); // Google CDN jQuery wp_enqueue_script('jquery'); // Enqueue it! // wp_register_script('conditionizr', '//cdnjs.cloudflare.com/ajax/libs/conditionizr.js/2.2.0/conditionizr.min.js', array(), '2.2.0', true); // // Conditionizr // wp_enqueue_script('conditionizr'); // Enqueue it! wp_register_script('modernizr', '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js', array(), '2.6.2', true); // Modernizr wp_enqueue_script('modernizr'); // Enqueue it! if($_SERVER["HTTP_HOST"] == $GLOBALS['localUrl']){ wp_register_script('plugins', get_template_directory_uri() . '/assets/js/plugins.js', array(), '', true); wp_enqueue_script('plugins'); wp_register_script('html5blankscripts', get_template_directory_uri() . '/assets/js/main.js', array(), '', true); wp_enqueue_script('html5blankscripts'); } else { wp_register_script('html5blankscripts', get_template_directory_uri() . '/assets/js/script.min.js', array(), '', true); wp_enqueue_script('html5blankscripts'); } wp_localize_script('html5blankscripts', 'wp_urls', array( 'template_dir' => get_template_directory_uri(), //'pageID' => icl_object_id( get_the_ID() , 'page', true, ICL_LANGUAGE_CODE), 'categoryID' => get_query_var('cat'), 'globalIds' => json_encode($GLOBALS['ownId']), 'isHome' => is_front_page(), 'ajaxObj' => admin_url('admin-ajax.php') )); } } // Load HTML5 Blank styles function html5blank_styles() { wp_register_style('googleFontLato', '//fonts.googleapis.com/css?family=Lato:300,400,700', array(), '1.0', 'all'); wp_enqueue_style('googleFontLato'); if ( ! is_admin() && ! is_login_page() ) { if($_SERVER["HTTP_HOST"] == $GLOBALS['localUrl']){ wp_register_style('ownstyles', get_template_directory_uri() . '/assets/css/own-styles.css', array(), '1.0', 'all'); wp_enqueue_style('ownstyles'); } else { wp_register_style('ownstyles', get_template_directory_uri() . '/assets/css/style.min.css', array(), '1.0', 'all'); wp_enqueue_style('ownstyles'); } } } // Register HTML5 Blank Navigation function register_html5_menu() { register_nav_menus( array( // Using array to specify more menus if needed 'header-menu' => __('Header Menu', 'html5blank'), // Main Navigation 'sidebar-menu' => __('Sidebar Menu', 'html5blank'), // Sidebar Navigation 'extra-menu' => __('Extra Menu', 'html5blank'), // Extra Navigation if needed (duplicate as many as you need!) 'footer-menu' => __('Footer Menu', 'html5blank') // Extra Navigation if needed (duplicate as many as you need!) ) ); } // Remove the
surrounding the dynamic navigation to cleanup markup function my_wp_nav_menu_args($args = '') { $args['container'] = false; return $args; } // Remove Injected classes, ID's and Page ID's from Navigation
  • items function my_css_attributes_filter($var) { return is_array($var) ? array() : ''; } // Remove invalid rel attribute values in the categorylist function remove_category_rel_from_category_list($thelist) { return str_replace('rel="category tag"', 'rel="tag"', $thelist); } // Add page slug to body class, love this - Credit: Starkers Wordpress Theme function add_slug_to_body_class($classes) { global $post; if (is_home()) { $key = array_search('blog', $classes); if ($key > -1) { unset($classes[$key]); } } elseif (is_page()) { $classes[] = sanitize_html_class($post -> post_name); } elseif (is_singular()) { $classes[] = sanitize_html_class($post -> post_name); } return $classes; } // If Dynamic Sidebar Exists if (function_exists('register_sidebar')) { // Define Sidebar Widget Area 1 register_sidebar( array( 'name' => __('Widget Area 1', 'html5blank'), 'description' => __('Description for this widget-area...', 'html5blank'), 'id' => 'widget-area-1', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' ) ); // Define Sidebar Widget Area 2 register_sidebar( array( 'name' => __('Widget Area 2', 'html5blank'), 'description' => __('Description for this widget-area...', 'html5blank'), 'id' => 'widget-area-2', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' ) ); } // Remove wp_head() injected Recent Comment styles function my_remove_recent_comments_style() { global $wp_widget_factory; remove_action('wp_head', array($wp_widget_factory -> widgets['WP_Widget_Recent_Comments'], 'recent_comments_style')); } // Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin function html5wp_pagination() { global $wp_query; $big = 999999999; echo paginate_links( array( 'base' => str_replace($big, '%#%', get_pagenum_link($big)), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query -> max_num_pages ) ); } // Custom Excerpts function html5wp_index($length)// Create 20 Word Callback for Index page Excerpts, call using html5wp_excerpt('html5wp_index'); { return 20; } // Create 40 Word Callback for Custom Post Excerpts, call using html5wp_excerpt('html5wp_custom_post'); function html5wp_custom_post($length) { return 40; } // Create the Custom Excerpts callback function html5wp_excerpt($length_callback = '', $more_callback = '') { global $post; if (function_exists($length_callback)) { add_filter('excerpt_length', $length_callback); } if (function_exists($more_callback)) { add_filter('excerpt_more', $more_callback); } $output = get_the_excerpt(); $output = apply_filters('wptexturize', $output); $output = apply_filters('convert_chars', $output); $output = '

    ' . $output . '

    '; echo $output; } // Custom View Article link to Post function html5_blank_view_article($more) { global $post; return '... ' . __('View Article', 'html5blank') . ''; } // Remove Admin bar function remove_admin_bar() { if (is_user_logged_in()) { return false; } } // Remove 'text/css' from our enqueued stylesheet function html5_style_remove($tag) { return preg_replace('~\s+type=["\'][^"\']++["\']~', '', $tag); } // Remove thumbnail width and height dimensions that prevent fluid images in the_thumbnail function remove_thumbnail_dimensions($html) { $html = preg_replace('/(width|height)=\"\d*\"\s/', "", $html); return $html; } // Custom Gravatar in Settings > Discussion function html5blankgravatar($avatar_defaults) { $myavatar = get_template_directory_uri() . '/assets/img/gravatar.png'; $avatar_defaults[$myavatar] = "Custom Gravatar"; return $avatar_defaults; } // Threaded Comments function enable_threaded_comments() { if (!is_admin()) { if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { wp_enqueue_script('comment-reply'); } } } /*------------------------------------*\ Actions + Filters + ShortCodes \*------------------------------------*/ // Add Actions add_action('init', 'html5blank_styles'); // Add Conditional Page Scripts add_action('get_header', 'enable_threaded_comments'); // Enable Threaded Comments add_action('wp_enqueue_scripts', 'html5blank_header_scripts'); // Add Theme Stylesheet add_action('init', 'register_html5_menu'); // Add HTML5 Blank Menu //add_action('init', 'create_post_type_html5'); // Add our HTML5 Blank Custom Post Type, Demo (Commented out by Default) add_action('widgets_init', 'my_remove_recent_comments_style'); // Remove inline Recent Comment Styles from wp_head() add_action('init', 'html5wp_pagination'); // Add our HTML5 Pagination // Remove Actions remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed remove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link remove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file. remove_action('wp_head', 'index_rel_link'); // Index link remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Prev link remove_action('wp_head', 'start_post_rel_link', 10, 0); // Start link remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // Display relational links for the posts adjacent to the current post. remove_action('wp_head', 'wp_generator'); // Display the XHTML generator that is generated on the wp_head hook, WP version remove_action('wp_head', 'start_post_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'rel_canonical'); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); // Add Filters add_filter('avatar_defaults', 'html5blankgravatar'); // Custom Gravatar in Settings > Discussion add_filter('body_class', 'add_slug_to_body_class'); // Add slug to body class (Starkers build) add_filter('widget_text', 'do_shortcode'); // Allow shortcodes in Dynamic Sidebar add_filter('widget_text', 'shortcode_unautop'); // Remove

    tags in Dynamic Sidebars (better!) add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args'); // Remove surrounding

    from WP Navigation // add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • injected classes (Commented out by default) // add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • injected ID (Commented out by default) // add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation
  • Page ID's (Commented out by default) add_filter('the_category', 'remove_category_rel_from_category_list'); // Remove invalid rel attribute add_filter('the_excerpt', 'shortcode_unautop'); // Remove auto

    tags in Excerpt (Manual Excerpts only) add_filter('the_excerpt', 'do_shortcode'); // Allows Shortcodes to be executed in Excerpt (Manual Excerpts only) add_filter('excerpt_more', 'html5_blank_view_article'); // Add 'View Article' button instead of [...] for Excerpts add_filter('show_admin_bar', 'remove_admin_bar'); // Remove Admin bar add_filter('style_loader_tag', 'html5_style_remove'); // Remove 'text/css' from enqueued stylesheet add_filter('post_thumbnail_html', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to thumbnails add_filter('image_send_to_editor', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to post images // Remove Filters remove_filter('the_excerpt', 'wpautop'); // Remove

    tags from Excerpt altogether /*------------------------------------*\ herrlich Media Functions \*------------------------------------*/ // Add LESS Support for wp_register_styles // http://x3graphics.com/tutorials/wordpress/adding-less-css-to-wordpress function enqueue_less_styles($tag, $handle) { global $wp_styles; $match_pattern = '/\.less$/U'; if (preg_match($match_pattern, $wp_styles -> registered[$handle] -> src)) { $tag = preg_replace("/='stylesheet'/", "='stylesheet/less'", $tag); } return $tag; } add_filter('style_loader_tag', 'enqueue_less_styles', 5, 2); // Custom Admin Backend Login function LB_custom_login_style() { echo ''; } add_action('login_enqueue_scripts', 'LB_custom_login_style'); function LB_login_logo_url() { return 'http://herrlich.media'; } add_filter('login_headerurl', 'LB_login_logo_url'); function LB_login_logo_title() { return 'Powered by herrlich media'; } add_filter('login_headertitle', 'LB_login_logo_title'); function remove_wp_logo() { global $wp_admin_bar; $wp_admin_bar -> remove_menu('wp-logo'); } add_action('wp_before_admin_bar_render', 'remove_wp_logo'); // Security: Hide Usernames from Classes function andys_remove_comment_author_class($classes) { foreach ($classes as $key => $class) { if (strstr($class, "comment-author-")) { unset($classes[$key]); } } return $classes; } add_filter('comment_class', 'andys_remove_comment_author_class'); class WP_HTML_Compression { // Settings protected $compress_css = true; protected $compress_js = true; protected $info_comment = true; protected $remove_comments = true; // Variables protected $html; public function __construct($html) { if (!empty($html)) { $this -> parseHTML($html); } } public function __toString() { return $this -> html; } protected function bottomComment($raw, $compressed) { $raw = strlen($raw); $compressed = strlen($compressed); $savings = ($raw - $compressed) / $raw * 100; $savings = round($savings, 2); // return ''; } protected function minifyHTML($html) { $pattern = '/<(?